package IniTester;

import inireader.Configurator;
import inireader.Validity;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;


public class IniTest
{
	public static void main(String[] args) throws SAXException, IOException, ParserConfigurationException
	{
		Configurator config = null;

		config = new Configurator("config.xml", Validity.Relaxed);

		try
		{
//	   System.out.println(System.getProperty("user.dir"));
			config.loadINI("config.ini.full");

			System.out.println(config.toString());

			config.getSection("Cisla").getProperty("cele").getElementOnIndex(0).setUnnormalizedValue("-3285");

			config.saveINI("config.ini.output");
		}

		catch (FileNotFoundException ex)
		{
			Logger.getLogger(IniTest.class.getName()).log(Level.SEVERE, null, ex);
		}		catch (IOException ex)
		{
			Logger.getLogger(IniTest.class.getName()).log(Level.SEVERE, null, ex);
		}
	}
}
